import { defHttp } from '/@/utils/http/axios';

import { QueryParams,DataItem } from './data';

enum Api {
  queryPage = '/dashboard/test/queryPage',
  saveOrUpdate = '/dashboard/test/saveOrUpdate',
  deleteById = '/dashboard/test/deleteById/',
  details = '/dashboard/test/details/'
}
//查询列表数据
export const queryPageData = (queryParams: QueryParams) => defHttp.post({ url: Api.queryPage, params: queryParams });
//新增或编辑数据
export const saveOrUpdate = (param: DataItem) => defHttp.post({ url: Api.saveOrUpdate, params: param });
//删除一条记录
export const deleteById = (id: number) => defHttp.post({ url: Api.deleteById+id});
//数据详情
export const details = (id: number) => defHttp.get({ url: Api.details+id});


